/*
 * @(#)cn.design.pattern.inversion 2020/4/8/0008
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.inversion.improve;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/8/0008
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class DependencyInversion {
	public static void main(String[] args) {
		Email email = new Email();
		new Person().receive(email);
	}
}

interface IReceiver {
	public String getInfo();
}

class Person {
	public void receive(IReceiver receiver) {
		System.out.println(receiver.getInfo());
	}
}

class Email implements IReceiver {
	public String getInfo() {
		return "电子邮件信息";
	}
}

class Wexin implements IReceiver {
	public String getInfo() {
		return "微信消息";
	}
}